| Conditions | 1 |
| Paths | 1 |
| Total Lines | 17 |
| Code Lines | 12 |
| Lines | 0 |
| Ratio | 0 % |
| Changes | 0 | ||
| 1 | // CodeMirror, copyright (c) by Marijn Haverbeke and others |
||
| 15 | })(function(CodeMirror) { |
||
| 16 | "use strict"; |
||
| 17 | |||
| 18 | CodeMirror.registerHelper("lint", "json", function(text) { |
||
| 19 | var found = []; |
||
| 20 | jsonlint.parseError = function(str, hash) { |
||
| 21 | var loc = hash.loc; |
||
| 22 | found.push({from: CodeMirror.Pos(loc.first_line - 1, loc.first_column), |
||
| 23 | to: CodeMirror.Pos(loc.last_line - 1, loc.last_column), |
||
| 24 | message: str}); |
||
| 25 | }; |
||
| 26 | try { jsonlint.parse(text); } |
||
| 27 | catch(e) {} |
||
| 28 | return found; |
||
| 29 | }); |
||
| 30 | |||
| 31 | }); |
||
| 32 |
This checks looks for references to variables that have not been declared. This is most likey a typographical error or a variable has been renamed.
To learn more about declaring variables in Javascript, see the MDN.